const express = require("express");
var route = express.Router();

route.get("/", (req, res) => {
  console.log("get");
  res.send("get");
});
route.post("/", (req, res) => {
  console.log("post");
  res.status(200).send("post");
});
route.put("/:id", (req, res) => {
  console.log("id is:", req.params.id);
  console.log("req.body:", req.body);
  res.send({
    id: req.params.id,
    ...req.body,
  });
});
route.delete("/:id", (req, res) => {
  console.log("delete id:", req.params.id);
  res.status(204).send();
});

module.exports = route;
